package org.moonlight.jvm.instructions.loads.xaload;

import org.moonlight.jvm.rtda.exclusive.OperandStack;
import org.moonlight.jvm.rtda.share.Object;

/**
 * f_a_load指令: 按索引取数组元素值( float类型 )，然后推入操作数栈
 *
 * @author Moonlight
 * @createTime 2023/9/15 14:54
 **/
public class FALoad extends XALoad {

    @Override
    protected void xLoad(OperandStack stack, int idx, Object arrRef) {
        float[] floats = arrRef.floats();
        checkIndex(floats.length, idx);
        stack.pushFloat(floats[idx]);
    }

}
